import {NgModule} from "@angular/core";
import {RouterModule, Routes} from "@angular/router";
import {HomeViewComponent} from "./views/home-view/home-view.component";
import {AboutViewComponent} from "./views/about-view/about-view.component";
import {CooperateViewComponent} from "./views/cooperate-view/cooperate-view.component";
import {ERentingViewComponent} from "./views/e-renting-view/e-renting-view.component";
import {LifeServiceViewComponent} from "./views/life-service-view/life-service-view.component";
import {RentingMallViewComponent} from "./views/renting-mall-view/renting-mall-view.component";
import {ProjectDetailViewComponent} from "./views/project-detail-view/project-detail-view.component";
import {PersonalComponent} from "./views/personal/personal.component";
import {MyProfileViewComponent} from "./views/my-profile-view/my-profile-view.component";
import {MyBookingViewComponent} from "./views/my-booking-view/my-booking-view.component";
import {MyRentingViewComponent} from "./views/my-renting-view/my-renting-view.component";
import {MyRepairViewComponent} from "./views/my-repair-view/my-repair-view.component";
import {MyCleaningViewComponent} from "./views/my-cleaning-view/my-cleaning-view.component";
import {MyLeaseViewComponent} from "./views/my-lease-view/my-lease-view.component";
import {MyLifepaymentViewComponent} from "./views/my-lifepayment-view/my-lifepayment-view.component";
import {MySysmsgViewComponent} from "./views/my-sysmsg-view/my-sysmsg-view.component";
import {MySuggestionViewComponent} from "./views/my-suggestion-view/my-suggestion-view.component";
import {LoginGuard} from "./guard/login.guard";
import {RentingViewComponent} from "./views/renting-view/renting-view.component";
import {PlaceOrderViewComponent} from "./views/place-order-view/place-order-view.component";
import {ContractViewComponent} from "./views/contract-view/contract-view.component";
import {ConfirmPaymentViewComponent} from "./views/confirm-payment-view/confirm-payment-view.component";
import {FinishedPaymentViewComponent} from "./views/finished-payment-view/finished-payment-view.component";
import {WechatPaymentViewComponent} from "./views/wechat-payment-view/wechat-payment-view.component";
import {StoryDetailViewComponent} from "./views/story-detail-view/story-detail-view.component";
import {MyBalanceViewComponent} from "./views/my-balance-view/my-balance-view.component";
import {RentingMallDetailViewComponent} from "./views/renting-mall-detail-view/renting-mall-detail-view.component";
import {ScoreViewComponent} from "./views/score-view/score-view.component";
import {ScoreMallViewComponent} from "./views/score-mall-view/score-mall-view.component";
import {CleaningMallViewComponent} from "./views/cleaning-mall-view/cleaning-mall-view.component";
import {CleaningMallDetailViewComponent} from "./views/cleaning-mall-detail-view/cleaning-mall-detail-view.component";
import {ScoreMallDetailViewComponent} from "./views/score-mall-detail-view/score-mall-detail-view.component";

const routes: Routes = [
  {path: '', redirectTo: '/home', pathMatch: 'full'},
  {
    path: 'home',
    component: HomeViewComponent,
    children: []
  },
  {
    path: 'about',
    component: AboutViewComponent,
    children: []
  },
  {
    path: 'cooperate',
    component: CooperateViewComponent,
    children: []
  },
  {
    path: 'e-renting',
    component: ERentingViewComponent,
    children: []
  },
  {
    path: 'renting/:id',
    component: RentingViewComponent,
    children: []
  },
  {
    path:'place_order/:id/:payType',
    component:PlaceOrderViewComponent
  },
  {
    path:'contract',
    component:ContractViewComponent
  },
  {
    path:'confirm_payment/:id',
    component:ConfirmPaymentViewComponent
  },
  {
    path:'finished_payment',
    component:FinishedPaymentViewComponent
  },
  {
    path: 'life-service',
    component: LifeServiceViewComponent,
    children: []
  },
  {
    path: 'renting-mall',
    component: RentingMallViewComponent,
    children: []
  },
  {
    path:'rentingMallDetail',
    component:RentingMallDetailViewComponent
  },
  {
    path:'cleaningMallDetail',
    component:CleaningMallDetailViewComponent
  },
  {
    path:'scoreMallDetail',
    component:ScoreMallDetailViewComponent
  },
  {
    path: 'score-mall',
    component: ScoreMallViewComponent,
    children: []
  },
  {
    path: 'cleaning-mall',
    component: CleaningMallViewComponent,
    children: []
  },
  {
    path: 'project/:id',
    component: ProjectDetailViewComponent,
    data: {class: ['padding-bottom-30']}
  },

  {
    path: 'personal',
    component: PersonalComponent,
    children: [
      {path: '', component: MyProfileViewComponent},
      {path: 'mybooking', component: MyBookingViewComponent},
      {path: 'myrenting', component: MyRentingViewComponent},
      {path: 'myrepair', component: MyRepairViewComponent},
      {path: 'mycleaning', component: MyCleaningViewComponent},
      {path: 'mylease', component: MyLeaseViewComponent},
      {path: 'mylifepayment', component: MyLifepaymentViewComponent},
      {path: 'mysysmsg', component: MySysmsgViewComponent},
      {path: 'mysuggestion', component: MySuggestionViewComponent},
      {path:'mybalance',component:MyBalanceViewComponent},
      {path:'myscore',component:ScoreViewComponent}
    ],
    canActivate: [LoginGuard]
  },
  {
    path:'wechatpayment',
    component:WechatPaymentViewComponent,
    children:[]
  },
  {
    path:'story',
    component:StoryDetailViewComponent,
    children:[]
  }
];
@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
  providers: [LoginGuard]
})
export class AppRoutingModule {

}
